﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ServiceNetworkDesign.Utilities
{
    public class Common
    {
        public static List<string> GetNodeIdListByEdges(List<Edge> edgelist)
        {

            if (edgelist == null || edgelist.Count() < 1) return null;
            List<string> nodeIdList = new List<string>();
            foreach (Edge edge in edgelist)
            {
                if (!nodeIdList.Contains(edge.StartNodeID))
                {
                    nodeIdList.Add(edge.StartNodeID);
                }
                if (!nodeIdList.Contains(edge.EndNodeID))
                {
                    nodeIdList.Add(edge.EndNodeID);
                }
            }
            return nodeIdList;
        }
    }
}
